---

import fs from "node:fs";
import path from "node:path";
import { footerConfig, profileConfig } from "../config";
import { url } from "../utils/url-utils";

const currentYear = new Date().getFullYear();

// 读取FooterConfig.html文件内容
let customFooterHtml = "";
if (footerConfig.enable) {
	try {
		const footerConfigPath = path.join(
			process.cwd(),
			"src",
			"FooterConfig.html",
		);
		customFooterHtml = fs.readFileSync(footerConfigPath, "utf-8");
		// 移除HTML注释
		customFooterHtml = customFooterHtml.replace(/<!--[\s\S]*?-->/g, "").trim();
	} catch (error) {
		console.warn("FooterConfig.html文件读取失败:", error.message);
	}
}
---

<!--<div class="border-t border-[var(&#45;&#45;primary)] mx-16 border-dashed py-8 max-w-[var(&#45;&#45;page-width)] flex flex-col items-center justify-center px-6">-->
<div class="transition border-t border-black/10 dark:border-white/15 my-10 border-dashed mx-32"></div>
<!--<div class="transition bg-[oklch(92%_0.01_var(&#45;&#45;hue))] dark:bg-black rounded-2xl py-8 mt-4 mb-8 flex flex-col items-center justify-center px-6">-->
<div class="transition border-dashed border-[oklch(85%_0.01_var(--hue))] dark:border-white/15 rounded-2xl mb-12 flex flex-col items-center justify-center px-6">
    <div class="transition text-50 text-sm text-center">
        {customFooterHtml && (
            <div class="mb-2" set:html={customFooterHtml}></div>
        )}
        &copy;
		<span id="copyright-year">{currentYear}</span>
		{profileConfig.name}. All Rights Reserved. /
        <a class="transition link text-[var(--primary)] font-medium" target="_blank" href={url('rss/')}>RSS</a> /
        <a class="transition link text-[var(--primary)] font-medium" target="_blank" href={url('sitemap-index.xml')}>Sitemap</a><br>
        Powered by
        <a class="transition link text-[var(--primary)] font-medium" target="_blank" href="https://astro.build">Astro</a>
		&
        <a class="transition link text-[var(--primary)] font-medium" target="_blank" href="https://github.com/matsuzaka-yuki/mizuki">Mizuki</a>
		Version
		<a class="transition link text-[var(--primary)] font-medium" target="_blank" href="https://github.com/matsuzaka-yuki/mizuki">4.9.3</a>
		&
		<a class="transition link text-[var(--primary)] font-medium" target="_blank" href="https://gitee.com/hongweifei/cyue-share-open">cyue-share</a>		<br>
	</div>
</div>
